﻿<%@page contentType="text/vnd.wap.wml; charset=utf-8"%>
<%@ page import="java.io.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.text.*"%>
<%@ page import="common.*"%>
<%@ page import="wapbean.*"%>

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org//DTD//wml_1.1.xml">   
<wml> 
<%
	
%>
<card id="card1" title="游戏列表">  
<p align="left">

 <img src="/game3.0/img/logo.png" alt=""/><br />     

   <%     String purl = request.getParameter("purl");
          String CategoryID = request.getParameter("CategoryID");
	      String MobileModelID = request.getParameter("MobileModelID");
		  String ProviderID = request.getParameter("ProviderID");
	//	  String wapcategoryname = request.getParameter("gamename4");
	//    System.out.println("CategoryID111111=="+CategoryID);
	//    System.out.println("MobileModelID111111=="+MobileModelID);
	//    System.out.println("ProviderID111111=="+ProviderID);
    //      String name = new String(wapcategoryname.getBytes("iso-8859-1"),"utf-8");
		  	WapcategoryFactory Fac = new WapcategoryFactory();
	//		 Vector ver = Fac.getMobilemodelContent1(CategoryID,purl);
			 Allbean be= Fac.getWapcategoryTitel(CategoryID);  
			 
			  NewFactory newF= new NewFactory();  
			Vector  ver = newF.getMobilemodelContentlist(CategoryID,MobileModelID);
	       
	%>             
    [<%=be.getTitle()%>]     

	<br /> 
<!--	<a href="http://wap.leyoou.cn/game3.0/StoryServlet?CategoryID=68&amp;mobileModelId=<%=MobileModelID%>&amp;purl=<%=purl%>">免流量精彩视频下载</a><br/> -->
		<jsp:include page="../includes/video_top.jsp"/>
			<%
   	           
					int 
					intPageSize=10,intRowCount=0,intPageCount=0,intPage=1;
   	                if(ver!=null&&!ver.isEmpty()){
                    int a=ver.size(); 
                      String strPage= request.getParameter("page");
                        if(strPage==null){
                                 intPage=1;
                                }
                           else{
                       try{
                           intPage=Integer.parseInt(strPage);
                            }catch(Exception e){
	                         e.printStackTrace();
                              }

                         if(intPage<1) intPage=1;

                             }

	   intRowCount = ver.size();
	   intPageCount=(intRowCount+intPageSize-1)/intPageSize;
       if(intPage>intPageCount){
           intPage=intPageCount;
       }
	   Iterator it=ver.iterator();
         int m=(intPage-1)*intPageSize;
          for(int i=0;i<m;i++){
		     it.next();
			 %>
			  <%
	   }
        %>
          <%
           int cnt=0;
           while(cnt<intPageSize && it.hasNext()){
            Allbean bea=(Allbean)it.next();
		   
                    //   System.out.println("a==="+a);
                    //   for(int t=0;t<a;t++){
                    //   Allbean bea=(Allbean)ver.elementAt(t);
                    
                    //  String CategoryID2=bea.getCategoryID();
					//  String MobileModelID=bea.getMobileModelID();
					//  String ProviderID=bea.getProviderID();
					//  System.out.println("MobileModelID==="+MobileModelID);     
					//  System.out.println("ProviderID==="+ProviderID);
                    //  System.out.println("kkkkk==="+CategoryID1);
                    // System.out.println("submitCode==="+bea.getSubmitCode()); 
   	 %> 
	<a href="/game3.0/wappages/contentViewgame.jsp?CategoryID=<%=CategoryID%>&amp;contentId=<%=bea.getContentId()%>&amp;MobileModelID=<%=MobileModelID%>&amp;ProviderID=<%=ProviderID%>&amp;purl=<%=purl%>&amp;ContentResourceID=<%=bea.getContentResourceID()%>&amp;cpId=<%=bea.getCpId()%>&amp;submitCode=<%=bea.getSubmitCode()%>&amp;gameresourceid=<%=bea.getGameResourceID()%>"> 
	<%=bea.getTitle()%></a><br />         
	<%  cnt++;}} %>
       <% if(intPage<intPageCount){ %>
				  <a href="gameList.jsp?CategoryID=<%=CategoryID%>&amp;MobileModelID=<%=MobileModelID%>&amp;ProviderID=<%=ProviderID%>&amp;purl=<%=purl%>&amp;page=<%=(intPage+1)%>">下一页</a>
				  <% }if(intPage>1){ %>
				  <a href="gameList.jsp?CategoryID=<%=CategoryID%>&amp;MobileModelID=<%=MobileModelID%>&amp;ProviderID=<%=ProviderID%>&amp;purl=<%=purl%>&amp;page=1">首页</a>
				  <a href="gameList.jsp?CategoryID=<%=CategoryID%>&amp;MobileModelID=<%=MobileModelID%>&amp;ProviderID=<%=ProviderID%>&amp;purl=<%=purl%>&amp;page=<%=(intPage-1)%>">上一页</a>
				  <a href="gameList.jsp?CategoryID=<%=CategoryID%>&amp;MobileModelID=<%=MobileModelID%>&amp;ProviderID=<%=ProviderID%>&amp;purl=<%=purl%>&amp;page=<%=(intPageCount)%>">末页</a>
				  <% }%> <br/>
		<a href="/game3.0/<%=purl%>.html">返回   </a><br />  
    
</p>		
</card>  
</wml>